using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication11.Models.Mapping
{
    public class Target_WireMap : EntityTypeConfiguration<Target_Wire>
    {
        public Target_WireMap()
        {
            // Primary Key
            this.HasKey(t => t.Wire_ID);

            // Properties
            this.Property(t => t.Wire_Name)
                .IsRequired()
                .HasMaxLength(20);

            this.Property(t => t.Target_Name_First)
                .IsRequired()
                .HasMaxLength(20);

            this.Property(t => t.Target_Name_Second)
                .HasMaxLength(50);

            this.Property(t => t.Wire_Info)
                .IsRequired()
                .HasMaxLength(20);

            this.Property(t => t.patient_id)
                .IsRequired()
                .HasMaxLength(20);

            this.Property(t => t.No_content)
                .IsRequired()
                .HasMaxLength(20);

            this.Property(t => t.To_wireID)
                .IsRequired()
                .HasMaxLength(20);

            this.Property(t => t.BZXX)
                .IsRequired()
                .HasMaxLength(20);

            this.Property(t => t.label)
                .HasMaxLength(20);

            // Table & Column Mappings
            this.ToTable("Target_Wire");
            this.Property(t => t.Wire_ID).HasColumnName("Wire_ID");
            this.Property(t => t.Wire_Name).HasColumnName("Wire_Name");
            this.Property(t => t.Target_ID).HasColumnName("Target_ID");
            this.Property(t => t.Target_Name_First).HasColumnName("Target_Name_First");
            this.Property(t => t.Target_Name_Second).HasColumnName("Target_Name_Second");
            this.Property(t => t.Star_Date).HasColumnName("Star_Date");
            this.Property(t => t.Wire_Info).HasColumnName("Wire_Info");
            this.Property(t => t.patient_id).HasColumnName("patient_id");
            this.Property(t => t.follow_up_id).HasColumnName("follow_up_id");
            this.Property(t => t.Create_Time).HasColumnName("Create_Time");
            this.Property(t => t.Update_Time).HasColumnName("Update_Time");
            this.Property(t => t.Ljsc).HasColumnName("Ljsc");
            this.Property(t => t.No_content).HasColumnName("No_content");
            this.Property(t => t.To_wireID).HasColumnName("To_wireID");
            this.Property(t => t.BZXX).HasColumnName("BZXX");
            this.Property(t => t.BZ).HasColumnName("BZ");
            this.Property(t => t.label).HasColumnName("label");
        }
    }
}
